<?php
class Frames_Controller_Plugin_View extends  Frames_Controller_Plugin_Base
{
	
	const PATH_TO_VIEW_INI = '/configs/view.ini';
	
	
	public function dispatchLoopStartup( Zend_Controller_Request_Abstract $request )
	{
		$_viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper( 'ViewRenderer' );
		$_viewRenderer->init( );
		try{
			$_config = new Zend_Config_Ini( APPLICATION_PATH.self::PATH_TO_VIEW_INI );
			$_viewRenderer->view->headMeta()->appendHttpEquiv("Content-Type","text/html; charset=UTF-8");
			$_viewRenderer->view->addHelperPath("Frames/View/Helper", "Frames_View_Helper");
			$this->appendStylesheet($_viewRenderer->view,$_config->css->toArray())
					->appendJs($_viewRenderer->view,$_config->js->toArray());
		}catch(Zend_Config_Exception $_exp){
			Frames_Debug::debug($_exp->getMessage( ) );
		}
	}
}


